﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;

namespace PROCEDURE
{
    class Program
    {
        static void Main(string[] args)
        {
             SqlConnection conSQL = new SqlConnection();
             conSQL. ConnectionString="Data Source=(local);Initial Catalog=sale; User Id=sa; Password=sa"; 
             conSQL.Open();
             SqlCommand commSQL = new SqlCommand();
             commSQL.Connection = conSQL;
             commSQL.CommandType = CommandType.StoredProcedure;
             commSQL.CommandText = "getCustomers";
             SqlParameter paramSQL = new SqlParameter("@id", SqlDbType.Int);
             paramSQL.Direction = ParameterDirection.Input;
             paramSQL.Value = 2;
             commSQL.Parameters.Add(paramSQL);
             SqlDataReader datRead = commSQL.ExecuteReader();
              Do while datRead.Read()
                {
                      Console.WriteLine ("ID: {0} - Name: {1}", dr[0],dr[1]);            
                }
 
                datRead.Close();


         }
        
    }
}
